package rs.networx.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="activations")
public class Activation implements java.io.Serializable {
	private static final long serialVersionUID = 4400942280528418444L;
	
	@Id
	@GeneratedValue (strategy = GenerationType.IDENTITY)
	@Column(name="activation_id" , unique = true , nullable = false)
	private Integer id;
	
	@Column(name="activation_code" , unique = false , nullable = false)
	private long activationCode;
	
	@OneToOne
	@JoinColumn(name="activator" , referencedColumnName="person_id" , nullable = false)
	private Person activator;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public long getActivationCode() {
		return activationCode;
	}

	public void setActivationCode(long activationCode) {
		this.activationCode = activationCode;
	}

	public Person getActivator() {
		return activator;
	}

	public void setActivator(Person activator) {
		this.activator = activator;
	}
	
	public Activation()
	{
		
	}
	public Activation(Long activationCode, Person activator) {
		super();
		this.activationCode = activationCode;
		this.activator = activator;
	}

	
}
